﻿package mortal.game.view.lookPlayerInfo.view
{
    import Message.Game.*;
    import Message.Public.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.component.window.*;

    public class LookOtherSystemBaseWin extends GSprite
    {
        private var _currentPanel:LookSystemBasePanel;
        private var _window:Window;
        protected var _slookPlayerMountInfo:SLookPlayerMountInfo;
        protected var _slookPlayerInfo:SLookPlayerInfo;
        protected var _lookType:int;

        public function LookOtherSystemBaseWin(param1:Window)
        {
            this._window = param1;
            return;
        }// end function

        public function set window(param1:Window) : void
        {
            this._window = param1;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            if (this._currentPanel)
            {
                this._currentPanel.dispose(param1);
                this._currentPanel = null;
            }
            this._slookPlayerMountInfo = null;
            this._slookPlayerInfo = null;
            super.disposeImpl(param1);
            return;
        }// end function

        protected function addPanel(param1:int) : void
        {
            var _loc_2:LookSystemBasePanel = null;
            if (this._currentPanel)
            {
                this._currentPanel.dispose();
                this._currentPanel = null;
            }
            switch(param1)
            {
                case ELookUpType._ELookUpTypePet:
                {
                    _loc_2 = this.addPetInfoPanel();
                    break;
                }
                case ELookUpType._ELookUpTypeFashion:
                case ELookUpType._ELookUpTypeWings:
                {
                    _loc_2 = this.addFasionPanel();
                    break;
                }
                case ELookUpType._ELookUpTypeWeapon:
                {
                    _loc_2 = this.addWeaponPanel();
                    break;
                }
                case ELookUpType._ELookUpTypeFightSoul:
                case ELookUpType._ELookUpTypeFightMethod:
                {
                    _loc_2 = this.addFightSoulPanel();
                    break;
                }
                case ELookUpType._ELookUpTypeDragonSoul:
                case ELookUpType._ELookUpTypeHolyBook:
                case ELookUpType._ELookUpTypeWarShield:
                case ELookUpType._ELookUpTypeMonsterSoul:
                {
                    _loc_2 = this.addDragonSoulPanel();
                    break;
                }
                default:
                {
                    _loc_2 = this.addInfoPanel();
                    break;
                    break;
                }
            }
            this._currentPanel = _loc_2;
            _loc_2.window = this._window;
            this.addChild(this._currentPanel);
            _loc_2.setLookInfo(this._slookPlayerMountInfo, this._slookPlayerInfo, this._lookType);
            return;
        }// end function

        private function addInfoPanel() : LookSystemBasePanel
        {
            var _loc_1:* = UICompomentPool.getUICompoment(LookSystemBasePanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        private function addPetInfoPanel() : LookPetInfoPanel
        {
            var _loc_1:LookPetInfoPanel = null;
            _loc_1 = UICompomentPool.getUICompoment(LookPetInfoPanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        private function addFasionPanel() : LookFashionInfoPanel
        {
            var _loc_1:LookFashionInfoPanel = null;
            _loc_1 = UICompomentPool.getUICompoment(LookFashionInfoPanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        private function addWeaponPanel() : LookWeaponInfoPanel
        {
            var _loc_1:* = UICompomentPool.getUICompoment(LookWeaponInfoPanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        private function addFightSoulPanel() : LookFightSoulPanel
        {
            var _loc_1:LookFightSoulPanel = null;
            _loc_1 = UICompomentPool.getUICompoment(LookFightSoulPanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        private function addDragonSoulPanel() : LookDragonSoulPanel
        {
            var _loc_1:LookDragonSoulPanel = null;
            _loc_1 = UICompomentPool.getUICompoment(LookDragonSoulPanel, this._window);
            _loc_1.x = -5;
            return _loc_1;
        }// end function

        public function setLookInfo(param1:SLookPlayerMountInfo, param2:SLookPlayerInfo, param3:int) : void
        {
            this._slookPlayerMountInfo = param1;
            this._slookPlayerInfo = param2;
            this._lookType = param3;
            this.addPanel(param3);
            return;
        }// end function

    }
}
